//
//  MyHomeView.m
//  ITHome
//
//  Created by lanou3g on 15/7/14.
//  Copyright (c) 2015年 YAX. All rights reserved.
//

#import "MyHomeView.h"

@implementation MyHomeView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        // 设置毛玻璃
        self.frostedGlass = [UIImageView imageWithBlurImage:@"weather_hdcover_rain@2x.png"];
        [self addSubview:_frostedGlass];
        
        // 创建表格
        [self createTableView];
        
        // 创建视图底部视图
        [self footerView];
    }
    return self;
}

#pragma mark - 创建tableView
- (void)createTableView
{
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 80, kScreenWidth - 100, kScreenHeight-64) style:UITableViewStylePlain];
    self.tableView.backgroundColor = [UIColor clearColor];
    self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
    [self addSubview:_tableView];
}

#pragma mark - 创建视图底部视图
- (void)footerView
{
    UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - 64, kScreenWidth, kScreenHeight - 64)];
    
    // 设置
    self.settingsButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.settingsButton.frame = CGRectMake(10, 10, 70, 50);
    [self.settingsButton itemWithTitle:@"设置" image:@"left_setting_icon_nt" highImage:@"left_setting_icon_h" titleSize:14];
    [footerView addSubview:_settingsButton];

    [self addSubview:footerView];
}

@end
